#pragma ident "$Id: CheckPhaseData.hpp $"

/**
 * @file CheckPhaseData.hpp
 * This is a class to check the phase data.
 */

#ifndef GPSTK_CHECK_PHASE_DATA_HPP
#define GPSTK_CHECK_PHASE_DATA_HPP

//============================================================================
//
//  Kaifa Kuang, Wuhan University, 2017
//
//============================================================================


#include "ProcessingClass.hpp"
#include "DataStructures.hpp"
#include "CommonHeader.hpp"

namespace gpstk
{

      /** @addtogroup GPSsolutions */
      //@{

      /** This class checkes the code data.
       *
       *  A typical way to use this class follows:
       *
       * @code
       *
       * @endcode
       *
       */
   class CheckPhaseData : public ProcessingClass
   {
   public:


         /// Default constructor.
      CheckPhaseData() : maxRMS(0.05), sourceRejected(false) {};


         /** Common constructor
          *
          * @param rms  Max RMS.
          *
          */
      CheckPhaseData(double rms) : maxRMS(rms), sourceRejected(false) {};


         /** Method to set the max RMS.
          *
          * @param rms  Max RMS.
          *
          */
      virtual CheckPhaseData& setMaxRMS(double rms)
      { maxRMS = rms; return (*this); };


         /** Return a satTypeValueMap object, adding the new data generated
          *  when calling this object.
          *
          * @param gData    Data object holding the data.
          */
      virtual satTypeValueMap& Process(satTypeValueMap& gData)
         noexcept(false);



         /** Return a gnssRinex object, adding the new data generated
          *  when calling this object.
          *
          * @param gData    Data object holding the data.
          */
      virtual void Process(commonHeader& comHeader, gnssRinex& gData)
         noexcept(false);


         /** Return a sourceRinex object, adding the new data generated
          *  when calling this object.
          *
          * @param gData    Data object holding the data.
          */
      virtual void Process(commonHeader& comHeader, sourceRinex& gData)
         noexcept(false);


         /// Return a string identifying this object.
      virtual std::string getClassName(void) const;


         /// Destructor.
      virtual ~CheckPhaseData() {};


   private:

         /// Previous data
      sourceRinex prevData;

         /// Max RMS
      double maxRMS;

         /// If this source to be rejected
      bool sourceRejected;

   }; // End of class 'CheckPhaseData'

      //@}

}  // End of namespace gpstk

#endif   // GPSTK_CHECK_PHASE_DATA_HPP
